package lion.crawl.parse;

import java.io.Serializable;

/**
 * @author Helin
 * @date 2012-8-17
 * @email hl_0074@sina.com
 * @desc
 */
public class Page implements Serializable {

	private static final long serialVersionUID = 1L;

	private String url;
	private String content;
	private int level = 1;
	private boolean crawled;

	public Page() {

		this(null, 0);
	}

	public Page(String url, int level) {

		this(url, null, level);
	}

	public Page(String url, String content, int level) {

		super();
		this.url = url;
		this.content = content;
		this.level = level;
	}

	public String getUrl() {

		return url;
	}

	public void setUrl(String url) {

		this.url = url;
	}

	public String getContent() {

		return content;
	}

	public void setContent(String content) {

		this.content = content;
	}

	public int getLevel() {

		return level;
	}

	public void setLevel(int level) {

		this.level = level;
	}

	public boolean isCrawled() {

		return crawled;
	}

	public void setCrawled(boolean crawled) {

		this.crawled = crawled;
	}

	@Override
	public boolean equals(Object other) {

		if (!(other instanceof Page)) { return false; }
		Page o = (Page) other;

		return this.url.equals(o.getUrl());
	}
}
